using System;
using System.Collections.Generic;
using System.Text;
using AWZhome.NQ.Core;
using AWZhome.NQ.CommonServices.Visual;
using System.IO;
using System.Reflection;

namespace AWZhome.NQ.CommonServices
{
	[NQServiceInterface]
	public interface ITestView2Service : IView
	{
	}

	[NQExportedService]
	[NQServiceAttachment(CommonAttachLists.PreferenceUI_PrefViews)]
	internal class TestView2 : ViewServiceBase, ITestView2Service
	{
		private TestViewVisual2 visual;

		public TestView2(ISession sessionService)
			: base(sessionService)
		{
			visual = new TestViewVisual2();
		}

		protected override bool CheckSessionType(ISession session)
		{
			return true;
		}

		public override string DisplayName
		{
			get
			{
				return "Allgemein";
			}
		}

		public override bool IsChanged
		{
			get
			{
				return false;
			}
		}

		public override bool CanBeClosed
		{
			get
			{
				return true;
			}
		}

		public override bool IsLoggable
		{
			get
			{
				return false;
			}
		}

		public override bool IsDocument
		{
			get
			{
				return false;
			}
		}

		public override object DisplayedObject
		{
			get
			{
				return visual;
			}
		}

		public override System.Windows.Media.ImageSource Icon
		{
			get
			{
				return null;
			}
		}

		public override ViewDisplayMode DockingType
		{
			get
			{
				return ViewDisplayMode.All;
			}
		}

		public override void Initialize(string context)
		{
			base.Initialize(context);

			IBarManager _servBar = visual.BarHostControlTest.BarService;
			_servBar.DockBottom = true;
			_servBar.DockTop = true;
			_servBar.DockLeft = false;
			_servBar.DockRight = false;
			Stream xmlstream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AWZhome.NQ.CommonServices.menudef.mainmenu.xml");
			_servBar.CreateItemsFromXml(xmlstream);
			xmlstream.Close();
			_servBar.LoadBarSettings();
			//_servBar.GetBand("maintlb").BandVisible = true;
			//_servBar.GetBand("maintlb_2").BandVisible = true;
			//_servBar.GetBand("SDKBrowserToolbar").DockDirection = NQBandDockDirection.DockTop;
			//_servBar.GetItem("SDKBrowserToolbar.ByComponent").ItemVisible = true;
		}
	}
}
